layui.define(['jquery', 'element', 'table'], function (exports) {
    "use strict";

    /**
     * 常用封装类
     * */
    var MOD_NAME = 'cheetah',
        $ = layui.jquery,
        table = layui.table,
        element = layui.element;

    let cheetah = new function () {


        // 获取URL参数
        this.getQueryString = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]);
            return null;
        }

        // 对象转 url 查询参数
        this.objToParam = function (obj) {
            return Object.keys(obj).map(key => {
                return key + '=' + obj[key]
            }).join('&')
        }

    }
    exports(MOD_NAME, cheetah);
});
